package com.qk.management.mapper;

import com.qk.domain.user.UserDO;
import com.qk.dto.user.UserDTO;
import com.qk.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    List<UserDO> selectByPage(UserDTO dto);

    void insert(User user);
    @Select("select * from user where id = #{id}")
    User selectById(Integer id);

    void update(User user);

    @Select("select * from user where username = #{username}")
    User selectByUsername(String username);

    void deleteById(List<Integer> ids);
    @Select("select * from user where role_id = #{id}")
    List<User> selectByRoleId(Integer id);
}
